# define _CRT_SECURE_NO_WARNINGS

#include "DList.h"


void Test1()
{
	DLNode* plist=DListInit();
	DListPushBack(plist, 1);
	DListPushBack(plist, 2);
	DListPushBack(plist, 3);
	DListPushBack(plist, 4);
	DListPrint(plist);

	DListPopBack(plist);
	DListPopBack(plist);
	DListPrint(plist);
}

void Test2()
{
	DLNode* plist = DListInit();
	DListPushFront(plist, 1);
	DListPushFront(plist, 2);
	DListPushFront(plist, 3);
	DListPushFront(plist, 4);
	DListPrint(plist);

	DListPopFront(plist);
	DListPrint(plist);
	DListPopFront(plist);
	DListPrint(plist);
}

void Test3()
{
	DLNode* plist = DListInit();
	DListInsert(plist, 1);
	DListInsert(plist, 2);
	DListInsert(plist, 3);
	DListInsert(plist, 4);
	DListPrint(plist);
	DListInsert(plist->next, 4);
	DListPrint(plist);

	DListErase(plist->next);
	DListPrint(plist);
	DListErase(plist->next);
	DListPrint(plist);

	DListDestory(plist);

}

int main()
{
	Test3();
	return 0;
}